<?php

namespace Apps\AppApi\Method\MyBranch;

use Apps\AppApi\Method\BaseMethod;
use PhalconPlus\Api\Common\ResultStatus;
use Apps\Common\Models\BeautyParlor;
use PhalconPlus\Common\Util;
use Apps\Common\Libs\SmaUtil;

/**
 * 移动管店
 * @author      545
 * @date        2016年3月12日
 * @version     1.1.2
 * @copyright   Copyright 2015 meelier.com
 */
class ShopManage extends BaseMethod
{
    private $url;
    private  $token = 'thebossawageincrease';
    private $success = 0;
    private $id = 0;

    public function run()
    {
    	/**
         * 验证用户权限
         */
        if(false == $this->verifyUserAuth()){
            return false;
        }
        $shopid = intval($this -> getDataItem('shop_id',0));
        
        if ($shopid ==0){
            return $this->errorLog(ResultStatus::POST_BODY_PARAM_ERROR,"id不能为空");
        }
        
//         $branch = BeautyParlor::findFirst("bp_id = {$bp_id}");
        
//         $branchid = $branch->branch_id;
        
        $smautil = new SmaUtil();
        
        $rs = $smautil->getStatistics($shopid);
        
        
        if ($rs){
            $this->setResult($rs);
        }
        else{
            $this->errorLog(ResultStatus::EMTPYS,"未获取数据");
        }
        
    }
    
    
    

}